home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 July / Ahoy_Magazine_87-07_1987_Double_L_Side_A.d64 / Plink & Plonk (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  10KB  |  257 lines

  1. 5 rem"       plink and plonk 3.0
  2. 6 [143]"       by walter e. meyers
  3. 10 goto 100
  4. 20 ln=21:col=5:gosub 50:print pl$(pl):return
  5. 30 sys 49188:c=(peek(v)-8)/40:r=(peek(v+1)-64)/24:return
  6. 35 col=3+((c3-1)*5):ln=5+((r3-1)*3):goto 50
  7. 40 ln=10:col=29
  8. 50 poke 781,ln:poke 782,col:poke 783,0:sys 65520:return
  9. 60 for i=s to s+24:poke i,0:next:return
  10. 70 poke s+24,15:poke s+5,45:poke s+6,165:poke s+4,33:poke s+1,6:poke s,5
  11. 75 for t=1to200:next:poke s+4,32:return
  12. 80 pokes+15,hn(p):pokes+1,ln(p):pokes+4,19:for t=1to30:next:poke s+4,18:return
  13. 99 rem --------------------- initialize
  14. 100 print"[147]one moment.":for i=3 to 6:poke 52213+i,i:next:h1=24:v1=50
  15. 110 h2=255:v2=200:v=53248:poke v+2,h1:poke v+3,v1:poke v+4,h2:poke v+5,v2
  16. 120 poke v+39,4:poke v+40,13:poke v+41,7:poke v+42,1:poke v+23,6:poke v+29,7
  17. 130 s=54272:bl=30:tempo=3:dim b$(17),po(8,8),hu$(2),ff$(5),pl$(7)
  18. 140 read a:if a=-99 then 180
  19. 150 goto 140
  20. 180 sprite=49344
  21. 190 for j=1 to 4:for i=sp to sp+63:read a:poke i,a:next:sp=sp+64:next
  22. 200 joy=49152
  23. 210 read a:if a=999 then 230
  24. 220 poke joy,a:joy=joy+1:goto 210
  25. 230 poke 56334,peek(56334) and 254:poke 1,peek(1) and 251:sys 49152
  26. 240 poke 1,peek(1) or 4:poke 56334,peek(56334) or 1
  27. 250 read a:if a=999 then 270
  28. 260 for i=0 to 7:read b:poke 61440+(a*8)+i,b:next:goto 250
  29. 270 poke 56576,(peek(56576) and 252):poke 53272,44:poke 648,200:print"[147]"
  30. 280 poke 53281,11:poke 53280,11:goto 4000
  31. 899 rem --------------------- draw grid
  32. 900 print"[147]":for j=1to5:for i=1to5:po(j,i)=0:next:next
  33. 910 for i=1to16:printtab(2) b$(i):next:ln=3:col=30:for j=1to2:for i=1to2
  34. 920 gosub 50:print hu$(i) "[209][209][209][209][209][209]":ln=ln+1:next:next:ps(1)=12:ps(2)=12
  35. 999 rem ----------------- placement seg
  36. 1000 pc(1)=7:pc(2)=13:poke 52216,3:for j=1to12:for p=1to2:poke v+21,0
  37. 1010 poke v+39,pc(p):poke v,128:poke v+1,136:poke v+21,1:pl=p
  38. 1020 gosub 20:gosub 30
  39. 1030 if po(r,c)<>0 then gosub 40:print m$(1):gosub 70:goto 1020
  40. 1040 if r=3 and c=3 then gosub 40:print m$(3):gosub 70:goto 1020
  41. 1050 po(r,c)=p:col=3+((c-1)*5):ln=5+((r-1)*3):gosub 80:gosub 50:print ff$(p)
  42. 1060 gosub 40:print m$(0):ln=2+(int(j/7))+p:col=bl:if j>6 then ln=ln+1
  43. 1070 if col>35 then col=30:bl=30
  44. 1080 gosub 50:print" ":next:bl=bl+1:next:ln=22:col=0:gosub 50:print bl$:p=2
  45. 1090 ln=21:col=0:gosub 50:print bl$:ln=22:col=8:gosub 50:print"and now--";
  46. 1100 for t=1to500:next:print "the fun begins!":for t=1to1000:next
  47. 1110 ln=22:col=0:gosub 50:print bl>
  48. 1189 :
  49. 1190 p=3-p:q=3-p
  50. 1199 rem -------------------:from where
  51. 1200 pl=p+2:gosub 20:printtab(10) pl$(7):poke v+21,0
  52. 1210 poke 52216,3:poke v+29,1:poke v+39,pc(p):poke v+21,1
  53. 1220 gosub 30:c1=c:r1=r
  54. 1230 if po(r1,c1)<>p then gosub 40:print m$(2):gosub 70:goto 1220
  55. 1240 poke v+21,0:poke 52216,6:poke v+29,0:poke v+21,1:po(r1,c1)=0:c3=c1:r3=r1
  56. 1250 gosub 35:print ff$(3):gosub 40:print m$(0)
  57. 1299 rem --------------------- to where
  58. 1300 pl=p+4:gosub 20:printtab(10)pl$(7)
  59. 1310 gosub 30:c2=c:r2=r
  60. 1320 if po(r2,c2)<>0 then gosub 40:print m$(1):gosub 70:goto 1370
  61. 1330 if r2=r1 and c2=c1 then gosub 40:print m$(4):gosub 70:goto 1370
  62. 1340 if abs(r2-r1)>1orabs(c2-c1)>1 then gosub 40:print m$(5):gosub 70:goto 1370
  63. 1350 po(r2,c2)=p:c3=c2:r3=r2:gosub 35:print ff$(p):poke v+21,0:gosub 80
  64. 1360 gosub 40:print m$(0):goto 2000
  65. 1370 po(r1,c1)=p:c3=c1:r3=r1:gosub 35:print ff$(p):goto 1210
  66. 1999 rem ----------- check for captures
  67. 2000 if po(r2-1,c2-1)<>q then 2050
  68. 2010 if po(r2-2,c2-2)=p then x=r2-1:y=c2-1:gosub 2500:goto 2050
  69. 2020 if po(r2-2,c2-2)=0 then 2050
  70. 2030 if po(r2-3,c2-3)=p then x=r2-1:y=c2-1:gosub 2500:x=r2-2:y=c2-2:gosub 2500
  71. 2049 :
  72. 2050 if po(r2-1,c2)<>q then 2100
  73. 2060 if po(r2-2,c2)=p then x=r2-1:y=c2:gosub 2500:goto 2100
  74. 2070 if po(r2-2,c2)=0 then 2100
  75. 2080 if po(r2-3,c2)=p then x=r2-1:y=c2:gosub 2500:x=r2-2:y=c2:gosub 2500
  76. 2099 :
  77. 2100 if po(r2-1,c2+1)<>q then 2150
  78. 2110 if po(r2-2,c2+2)=p then x=r2-1:y=c2+1:gosub 2500:goto 2150
  79. 2120 if po(r2-2,c2+2)=0 then 2150
  80. 2130 if po(r2-3,c2+3)=p then x=r2-1:y=c2+1:gosub 2500:x=r2-2:y=c2+2:gosub 2500
  81. 2149 :
  82. 2150 if po(r2,c2-1)<>q then 2200
  83. 2160 if po(r2,c2-2)=p then x=r2:y=c2-1:gosub 2500:goto 2200
  84. 2170 if po(r2,c2-2)=0 then 2200
  85. 2180 if po(r2,c2-3)=p then x=r2:y=c2-1:gosub 2500:y=c2-2:gosub 2500
  86. 2199 :
  87. 2200 if po(r2,c2+1)<>q then 2250
  88. 2210 if po(r2,c2+2)=p then x=r2:y=c2+1:gosub 2500:goto 2250
  89. 2220 if po(r2,c2+2)=0 then 2250
  90. 2230 if po(r2,c2+3)=p then x=r2:y=c2+1:gosub 2500:y=c2+2:gosub 2500
  91. 2249 :
  92. 2250 if po(r2+1,c2-1)<>q then 2300
  93. 2260 if po(r2+2,c2-2)=p then x=r2+1:y=c2-1:gosub 2500:goto 2300
  94. 2270 if po(r2+2,c2-2)=0 then 2300
  95. 2280 if po(r2+3,c2-3)=p then x=r2+1:y=c2-1:gosub 2500:x=r2+2:y=c2-2:gosub 2500
  96. 2299 :
  97. 2300 if po(r2+1,c2)<>q then 2350
  98. 2310 if po(r2+2,c2)=p then x=r2+1:y=c2:gosub 2500:goto 2350
  99. 2320 if po(r2+2,c2)=0 then 2350
  100. 2330 if po(r2+3,c2)=p then x=r2+1:y=c2:gosub 2500:x=r2+2:gosub 2500
  101. 2349 :
  102. 2350 if po(r2+1,c2+1)<>q then 2400
  103. 2360 if po(r2+2,c2+2)=p then x=r2+1:y=c2+1:gosub 2500:goto 2400
  104. 2370 if po(r2+2,c2+2)=0 then 2400
  105. 2380 if po(r2+3,c2+3)=p then x=r2+1:y=c2+1:gosub 2500:x=r2+2:y=c2+2:gosub 2500
  106. 2398 :
  107. 2399 rem ----------- check for game end
  108. 2400 if ps(q)>1 then 1190
  109. 2410 ln=21:col=3:gosub 50:print bl$:ln=22:gosub 50:print bl$:ln=21:gosub 50
  110. 2420 print "[155]that's it--player" p "wins!":poke v+21,0:poke v,255:poke v+1,180
  111. 2430 poke v+23,1:poke v+29,1:poke v+39,pc(p):if p=1 then poke 52216,5:goto 2450
  112. 2440 poke 52216,4
  113. 2450 poke v+21,1:ln=22:col=0:gosub 50:print "  another game?  hit [158]q to ";
  114. 2455 print "quit, or any":printtab(7) "other key to play again.":poke 198,0
  115. 2460 get ag$:if ag$="" then 2460
  116. 2470 if ag$<>"q" and ag$<>"[209]" then poke v+21,0:poke v+23,0:goto 900
  117. 2480 poke v+21,0:print "[147]":poke 53272,21:poke 648,4:poke 56576,peek(56576) or 3
  118. 2490 print "[147][154]":poke sc,6:poke bo,14:new:clr:end
  119. 2500 po(x,y)=0:col=3+((y-1)*5):ln=5+((x-1)*3):gosub 50:print ff$(q+3)
  120. 2510 for t=1to200:next:gosub 50:print ff$(3)
  121. 2520 ps(q)=ps(q)-1:return
  122. 2998 :
  123. 2999 rem ------------------------ title
  124. 3000 restore:print"[147]":gosub 60:cc=0:poke s+24,15:poke s+5,47:poke s+6,136:p=4
  125. 3010 poke v+21,6:ln=10:col=4:gosub 50
  126. 3020 print"[158]" p$l$i$n$k$ "[146] and [145][153]" p$l$o$n$k$
  127. 3030 read hi,lo,dur:p=6-p:if hi<0 then 3100
  128. 3040 a1=int(rnd(1)*(255-24)+24):a2=int(rnd(1)*(200-50)+50):poke v+p,a1
  129. 3050 poke v+p+1,a2:poke s+4,19:poke s+15,hi:poke s+1,lo:for t=1to dur*tempo
  130. 3060 next:poke s+4,18:rest=dur/2:for t=1 to rest*tempo:next:cc=cc+1
  131. 3070 if cc=27 then restore:goto 3030
  132. 3080 if cc<52 then 3030
  133. 3090 for i=1 to 2:read hi,lo,dur:next:goto 3030
  134. 3100 poke s+24,15:poke s+5,47:poke s+6,136:poke v+21,0:goto 900
  135. 3999 rem ---------------------- strings
  136. 4000 p$="[176][209][201][157][157][157][171][209][203][157][157][157][211][145][145]":l$="[193][157][194][157][173][195][145][145]":o$="[213][209][201][157][157][157][194][194][157][157][157][202][209][203][145][145]"
  137. 4010 n$="[176][209][201][157][157][157][194][194][157][157][157][211][211][145][145]":k$="[193][193][157][157][157][171][209][181][157][157][157][211][211][145][145]":i$="[193][157][194][157][211][145][145]"
  138. 4020 b$(1)="[144][176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]":b$(2)="[221]    [221]    [221]    [221]    [221]    [221]"
  139. 4040 for i=3 to 15:b$(i)=b$(2):next:    b$(4)="[171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
  140. 4050 for i=7 to 13 step 3:b$(i)=b$(4):next:b$(8)="[221]    [221]    [221]    [146][221]    [221]    [221]"
  141. 4060 b$(9)=b$(8):b$(16)="[173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]":hu$(1)="[158]":hu$(2)="[153]"
  142. 4100 m$(0)= "          [157][157][157][157][157][157][157][157][157][157]          [157][157][157][157][157][157][157][157][157][157]          "
  143. 4110 m$(1)="someone's [157][157][157][157][157][157][157][157][157][157]there now.[157][157][157][157][157][157][157][157][157][157]try again."
  144. 4120 m$(2)="you don't [157][157][157][157][157][157][157][157][157][157]have one  [157][157][157][157][157][157][157][157][157][157]there.    "
  145. 4130 m$(3)="forbidden [157][157][157][157][157][157][157][157][157][157]zone!     [157][157][157][157][157][157][157][157][157][157]try again."
  146. 4140 m$(4)="you began [157][157][157][157][157][157][157][157][157][157]there.    [157][157][157][157][157][157][157][157][157][157]try again."
  147. 4150 m$(5)="can't move[157][157][157][157][157][157][157][157][157][157]that far! [157][157][157][157][157][157][157][157][157][157]try again."
  148. 4160 ff$(1)="[158]!#$%[157][157][157][157]&'()":ff$(2)="[153]*+,-[157][157][157][157]:;<=":ff$(3)="    [157][157][157][157]    "
  149. 4170 ff$(4)="[155]!#$%[157][157][157][157][204][205][206][207]":ff$(5)="[155]*+,-[157][157][157][157][214][215][216][218]"
  150. 4180 bl$="                                      "
  151. 4200 pl$(1)="[158]player 1: place a [158]plink.":pl$(2)="[153]player 2: place a [153]plonk."
  152. 4210 pl$(3)="[158]player 1: pick a [158]plink, then  "
  153. 4220 pl$(4)="[153]player 2: pick a [153]plonk, then  "
  154. 4230 pl$(5)="[158]player 1: make your move, and ":pl$(6)="[153]player 2:"
  155. 4240 pl$(7)="hit the fire button.":hn(1)=67:hn(2)=56:ln(1)=56:ln(2)=99
  156. 4990 goto 3000
  157. 4999 rem ------------------------ music
  158. 5000 data 67,15,16,33,135,8,37,162,8,37,162,8,42,62,8,42,62,8,44,193,8,56,99,16
  159. 5001 data 28,49,8,29,221,8,29,221,8,31,165,8,31,165,8,33,135,8,44,193,16
  160. 5002 data 25,30,8,29,223,8,44,193,16,25,30,8,29,223,8,44,193,8,42,62,8,42,62,8
  161. 5003 data 37,162,8,37,162,8,33,135,8,33,135,8,29,223,8,28,49,8,25,29,8,22,96,16
  162. 5004 data 0,0,0,0,0,0,-1,-1,-99
  163. 5099 rem ---------------------- sprites
  164. 5100 data 255,255,0,255,255,0,192,3
  165. 5101 data 0,192,3,0,192,3,0,192
  166. 5102 data 3,0,192,3,0,192,3,0
  167. 5103 data 192,3,0,192,3,0,192,3
  168. 5104 data 0,192,3,0,192,3,0,192
  169. 5105 data 3,0,192,3,0,192,3,0
  170. 5106 data 192,3,0,192,3,0,255,255
  171. 5107 data 0,255,255,0,0,0,0,0
  172. 5109 :
  173. 5110 data 0,0,0,0,255,0,7,24
  174. 5111 data 224,30,102,120,63,255,252,112
  175. 5112 data 24,14,119,153,238,254,24,127
  176. 5113 data 252,24,63,204,24,51,192,24
  177. 5114 data 3,255,255,255,71,231,226,112
  178. 5115 data 0,14,63,195,252,31,231,248
  179. 5116 data 7,255,224,0,255,0,0,0
  180. 5117 data 0,0,0,0,0,0,0,0
  181. 5119 :
  182. 5120 data 0,0,0,0,255,0,7,255
  183. 5121 data 224,31,255,248,56,63,236,96
  184. 5122 data 30,14,79,28,126,252,152,207
  185. 5123 data 252,216,31,231,251,231,199,255
  186. 5124 data 227,195,255,195,72,0,18,118
  187. 5125 data 24,110,63,24,252,31,255,248
  188. 5126 data 7,255,224,0,255,0,0,0
  189. 5127 data 0,0,0,0,0,0,0,0
  190. 5129 :
  191. 5130 data 255,128,0,204,223,0,204,223
  192. 5131 data 224,204,192,248,204,192,60,0
  193. 5132 data 120,30,112,204,14,224,204,7
  194. 5133 data 224,204,7,224,120,7,224,6
  195. 5134 data 103,224,6,103,112,6,110,120
  196. 5135 data 3,206,60,1,128,31,0,31
  197. 5136 data 7,255,152,0,255,159,0,0
  198. 5137 data 24,0,0,31,0,0,0,0
  199. 5199 rem ------ char transfer, joystick
  200. 5200 data 169,0,133,251,133,253,169,208
  201. 5201 data 133,252,169,240,133,254,162,16
  202. 5202 data 160,0,177,251,145,253,136,208
  203. 5203 data 249,230,252,230,254,202,208,240
  204. 5204 data 96,0,0,0,173,0,220,41
  205. 5205 data 15,201,14,240,20,201,13,240
  206. 5206 data 33,201,11,240,46,201,7,240
  207. 5207 data 59,173,0,220,41,16,208,228
  208. 5208 data 96,56,173,1,208,201,112,144
  209. 5209 data 219,233,24,141,1,208,76,136
  210. 5210 data 192,0,24,173,1,208,201,184
  211. 5211 data 176,202,105,24,141,1,208,76
  212. 5212 data 136,192,0,56,173,0,208,201
  213. 5213 data 88,144,185,233,40,141,0,208
  214. 5214 data 76,136,192,0,24,173,0,208
  215. 5215 data 201,208,176,168,105,40,141,0
  216. 5216 data 208,76,136,192,0,0,0,0
  217. 5217 data 162,200,160,0,200,208,253,202
  218. 5218 data 208,248,76,36,192,999
  219. 5299 rem ------------------ custom font
  220. 5300 data 161,0,0,1,7,14,12,31,31
  221. 5301 data 163,31,127,255,131,1,241,201,205
  222. 5302 data 164,248,254,255,254,224,199,140,129
  223. 5303 data 165,0,0,128,224,240,240,248,248
  224. 5304 data 166,30,28,12,12,7,1,0,0
  225. 5305 data 167,127,127,63,128,97,241,127,31
  226. 5306 data 168,190,254,252,1,134,143,254,248
  227. 5307 data 169,120,56,48,48,224,128,0,0
  228. 5308 data 170,0,0,1,7,15,15,31,31
  229. 5309 data 171,31,113,204,255,1,121,225,193
  230. 5310 data 172,248,142,51,255,128,158,135,131
  231. 5311 data 173,0,0,128,224,240,240,248,248
  232. 5312 data 186,28,28,15,12,7,1,0,0
  233. 5313 data 187,193,1,255,126,0,252,126,31
  234. 5314 data 188,131,128,255,126,0,63,126,248
  235. 5315 data 189,56,56,240,48,224,128,0,0
  236. 5316 data 193,0,0,0,60,60,60,60,60
  237. 5317 data 194,60,60,60,60,60,60,60,60
  238. 5318 data 195,0,0,0,252,252,0,0,0
  239. 5319 data 201,0,0,0,240,248,124,60,60
  240. 5320 data 202,60,60,62,31,15,0,0,0
  241. 5321 data 203,60,60,124,248,240,0,0,0
  242. 5322 data 204,30,28,13,15,7,1,0,0
  243. 5323 data 205,127,240,199,128,63,255,127,31
  244. 5324 data 206,190,15,227,1,252,255,254,248
  245. 5325 data 207,120,56,176,240,224,128,0,0
  246. 5326 data 209,0,0,0,255,255,0,0,0
  247. 5327 data 211,60,60,60,60,60,0,0,0
  248. 5328 data 213,0,0,0,15,31,62,60,60
  249. 5329 data 214,28,28,15,12,7,1,0,0
  250. 5330 data 215,193,1,255,120,243,243,120,31
  251. 5331 data 216,131,128,255,30,207,207,30,248
  252. 5332 data 218,56,56,240,48,224,128,0,0
  253. 5333 data 235,60,60,60,63,63,60,60,60
  254. 5334 data 237,60,60,60,63,63,0,0,0
  255. 5335 data 240,0,0,0,63,63,60,60,60
  256. 5336 data 245,60,60,120,240,240,120,60,60,999
  257.